module.exports = {
  /*
  ** Headers of the page
  */
  head: {
    title: '今夜头条',
    meta: [
      { charset: 'utf-8' },
      { name: 'viewport', content: 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no;' },
      { hid: 'description', name: 'description', content: 'egg example website' }
    ],
    link: [
      { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
    ]
  },
  /*
  ** Customize the progress bar color
  */
  loading: { color: '#3B8070' },
  /*
  ** Build configuration
  */
  build: {
    /*
    ** Run ESLint on save
    */
    extend (config, { isDev, isClient }) {
      if (isDev && isClient) {
        config.module.rules.push({
          enforce: 'pre',
          test: /\.(js|vue)$/,
          loader: 'eslint-loader',
          exclude: /(node_modules)/
        })
      }
    },
    /**
     * vendor
     */
    vendor: ['axios'],
    /**
     * postcss
     */
    postcss: [
      require('postcss-import')(),
      require('postcss-url')(),
      require('postcss-aspect-ratio-mini')(),
      require('postcss-write-svg')({ utf8: false }),
      require('postcss-cssnext')(),
      require('postcss-px-to-viewport')({
        viewportWidth: 375, // (Number) The width of the viewport.
        viewportHeight: 667, // (Number) The height of the viewport.
        unitPrecision: 3, // (Number) The decimal numbers to allow the REM units to grow to.
        viewportUnit: "vw", // (String) Expected units.
        selectorBlackList: [".ignore", ".hairlines"], // (Array) The selectors to ignore and leave as px.
        minPixelValue: 1, // (Number) Set the minimum pixel value to replace.
        mediaQuery: false // (Boolean) Allow px to be converted in media queries.
      }),
      require('postcss-viewport-units')({filterRule (rule) {
        // return rule.match(/\:\:before|\:\:after/)
      }}),
      require('cssnano')({
        preset: "advanced",
        autoprefixer: false,
        "postcss-zindex": false
      })
    ]
  },
  /**
   * plugins
   */
  plugins: ['~/plugins/vant', '~/plugins/style', '~/plugins/xss-filter'],

  /**
   * generate
   */
  generate: {
    routes: [
      '/article/55',
      '/article/56',
      '/article/57',
      '/article/58',
      '/article/54',
      '/article/51',
      '/article/52',
      '/article/53',
      '/article/47',
      '/article/48',
      '/article/49',
      '/article/50',
      '/article/44',
      '/article/45',
      '/article/46',
      '/article/40',
      '/article/41',
      '/article/42',
      '/article/43',
      '/article/37',
      '/article/38',
      '/article/39',
      '/article/33',
      '/article/34',
      '/article/35',
      '/article/36',
      '/article/15',
      '/article/14',
      '/article/2',
      '/channel/1',
      '/channel/2',
      '/channel/4',
      '/channel/5',
      '/channel/6',
      '/channel/7',
      '/channel/8',
      '/channel/9',
      '/channel/10',
      '/channel/11',

    ]
  }
}
